#ifndef __GGEAR_IMAGE_BUILDER_BMP_H
#define __GGEAR_IMAGE_BUILDER_BMP_H

#include "ggear_imagebuilder.h"
#include "ggear_image.h"

namespace ggear
{
	namespace gfx
	{
		struct BMPHeader
		{
			//! bitmap file header
			u16	Key;
			u32	FileSize;
			u32 Reserved;
			u32 OffBits;

			//! bitmap info header
			u32 InfoSize;
			s32 Width;
			s32 Height;
			u16 NumPlanes;
			u16 ColorBits;
			u32 Compression;
			u32 DataSize;
			s32 HResolution;
			s32 VResolution;
			u32 NumColors;			// Used for color table
			u32 NumKeyColors;		//
		};

		class ImageBuilderBMP : public ImageBuilder
		{
		public:
			//! Default constructor
			ImageBuilderBMP();

			//! Destructor
			~ImageBuilderBMP();

			//! Read BMP image from stream
			Image* Load(io::Stream& _inStream) const;

			//! Write BMP image to stream
			b8 Save(const Image& _img,io::Stream& _outStream) const;
		};
	}
}

#endif